<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select.apply(_self, arguments)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref="multipleTable" :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.taskstats.taskfinishgird_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type="selection" :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('finishedby')">
                <el-table-column show-overflow-tooltip :prop="'finishedby'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.finishedby')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.finishedby')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.finishedby" tag="UserRealName" codelistType="DYNAMIC" renderMode="STR" valueSeparator="," textSeparator="," ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('projectname')">
                <el-table-column show-overflow-tooltip :prop="'projectname'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.projectname')" :width="150"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.projectname')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.projectname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskid')">
                <el-table-column show-overflow-tooltip :prop="'taskid'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskid')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskid')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.taskid}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskname')">
                <el-table-column show-overflow-tooltip :prop="'taskname'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskname')" :min-width="200"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskname')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.taskname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskpri')">
                <el-table-column show-overflow-tooltip :prop="'taskpri'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskpri')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskpri')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.taskpri" tag="Task__pri" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskeststarted')">
                <el-table-column show-overflow-tooltip :prop="'taskeststarted'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskeststarted')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskeststarted')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD" :data="row.taskeststarted"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskrealstart')">
                <el-table-column show-overflow-tooltip :prop="'taskrealstart'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskrealstart')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskrealstart')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD" :data="row.taskrealstart"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskdeadline')">
                <el-table-column show-overflow-tooltip :prop="'taskdeadline'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskdeadline')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskdeadline')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD" :data="row.taskdeadline"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskfinisheddate')">
                <el-table-column show-overflow-tooltip :prop="'taskfinisheddate'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskfinisheddate')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskfinisheddate')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD" :data="row.taskfinisheddate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskdelay')">
                <el-table-column show-overflow-tooltip :prop="'taskdelay'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskdelay')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskdelay')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.taskdelay}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskestimate')">
                <el-table-column show-overflow-tooltip :prop="'taskestimate'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskestimate')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskestimate')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.taskestimate}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('totalconsumed')">
                <el-table-column show-overflow-tooltip :prop="'totalconsumed'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.totalconsumed')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.totalconsumed')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.totalconsumed}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taskcnt')">
                <el-table-column show-overflow-tooltip :prop="'taskcnt'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.taskcnt')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.taskcnt')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.taskcnt}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('projectconsumed')">
                <el-table-column show-overflow-tooltip :prop="'projectconsumed'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.projectconsumed')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.projectconsumed')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.projectconsumed}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('userconsumed')">
                <el-table-column show-overflow-tooltip :prop="'userconsumed'" :label="$t('entities.taskstats.taskfinishgird_grid.columns.userconsumed')" :width="100"  :align="'left'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.taskstats.taskfinishgird_grid.columns.userconsumed')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.userconsumed}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class="grid-pagination" v-show="items.length > 0">
            <page class="pull-right" @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>